import { SlideDto } from './../../shared/service-proxies/service-proxies';
import { Component, OnInit } from '@angular/core';
import { PublicServiceProxy } from '@shared/service-proxies/service-proxies';
import { finalize } from 'rxjs/operators';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss']
})
export class Tab1Page implements OnInit {
  
  loading=false;
  slides:SlideDto[]=[];
  ngOnInit(): void {
    this.loading=true;
    this.publicServiceProxy.getAllSlide().pipe(finalize(()=>{this.loading=false;}))
    .subscribe(q=>{
      this.slides=q;
    });
  }


   // Optional parameters to pass to the swiper instance. See http://idangero.us/swiper/api/ for valid options.
   slideOpts = {
    initialSlide: 1,autoplay:true,
    speed: 400
  };
  constructor(private publicServiceProxy:PublicServiceProxy) {

  }

}
